/*
 * Copyright 2006-2008 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.martinimix.service.payment.handler;

import net.martinimix.domain.payment.PaymentMethod;
import net.martinimix.service.payment.PaymentService;

import org.springframework.core.Ordered;

/**
 * Provides a payment handler for creating order payments.
 * 
 * @author Scott Rossillo
 *
 */
public interface PaymentHandler extends PaymentService, Ordered {
	
	/**
	 * Returns true if the given payment method requires authorization.
	 * 
	 * @param paymentMethod the <code>PaymentMethod</code> to return
	 * if requires authorization
	 * 
	 * @return <code>true</code> if the given <code>paymentMethod</code>
	 * requires authorization; <code>false</code> otherwise
	 */
	public boolean authorizationRequired(PaymentMethod paymentMethod);
	
	/**
	 * Returns true if this payment handler supports the given payment
	 * method.
	 * 
	 * @param paymentMethod the <code>PaymentMethod</code> to return
	 * if supported
	 *  
	 * @return <code>true</code> this payment handler supports the given 
	 * <code>paymentMethod</code>; <code>false</code> otherwise
	 */
	public boolean supports(PaymentMethod paymentMethod);
	
}
